package org.jash.d2211

import android.graphics.Color
import androidx.databinding.BaseObservable
import androidx.databinding.Bindable

data class Day (val day:Int):BaseObservable() {
    val str
        get() = String.format("%02d", day)
    @get:Bindable
    val color
        get() = if (day == current) Color.parseColor("#03A9F4") else Color.parseColor("#ffffff")
    fun click() {
        current = day
        days.forEach { it.notifyPropertyChanged(BR.color) }

    }
    companion object {
        var current:Int = 0
        var days:MutableList<Day> = mutableListOf()
    }
}